<!--
 * @Description: 
 * @Autor: Zhu_liangyu
 * @Date: 2020-05-31 17:28:39
--> 
<template>
  <div>
    <a-alert :message="'浏览器访问:'+anonymousUrl" type="info" banner closable />
    <basic-form
      ref="anonymousForm"
      v-model="anonymousForm"
      :rules="anonymousRules"
      primary-key="anonymousId"
      :query-api="anonymous_queryByIdApi"
      :insert-api="anonymous_insertApi"
      :update-api="anonymous_updateApi"
    >
      <a-form-model-item label="路径" prop="url" ref="url" :hasFeedback="true">
        <a-input v-model="anonymousForm.url" placeholder="请输入路径"></a-input>
      </a-form-model-item>
    </basic-form>
  </div>
</template>
<script>
import {
  anonymous_queryByIdApi,
  anonymous_insertApi,
  anonymous_updateApi
} from "@/api/org/anonymous";
import { anonymousRules } from "@/profile/org/anonymous";

export default {
  props: {
    anonymousId: {
      type: String
    }
  },
  data() {
    return {
      anonymousRules,
      anonymous_queryByIdApi,
      anonymous_insertApi,
      anonymous_updateApi,
      anonymousForm: {
        anonymousId: this.anonymousId
      }
    };
  },
  computed: {
    anonymousUrl() {
      return (
        location.protocol +
        "//" +
        location.host +
        "/future" +
        this.anonymousForm.url
      );
    }
  }
};
</script>